[asp]帮我看看,注册页面.

来源:百度知道 编辑:UC知道 时间:2024/06/15 03:40:13
<%
Sub save()
If Trim(Request.Form("Name")) = "" or Trim(Request.Form("Apassword")) = "" or Trim(Request.Form("Code")) = "" Then
response.write("<script>alert('您最少必须输入用户名、密码和验证码才能完成管理员注册!');location.href='AMaddadmin.asp'</script>")
Response.End
End If
If Trim(Request.Form("Code"))=Empty Or Trim(Session("ValidateCode"))<>Trim(Request.Form("Code")) Then
response.write("<script>alert('对不起,您输入的验证码不正确!');location.href='login.asp'</script>")
response.end
End if
mpassword=request.form("Apassword")
u_password=md5(mpassword)
Dim admin
Dim admin_numRows
Set admin = Server.CreateObject("ADODB.Recordset")
admin.ActiveConnection = MM_conn_STRING
admin.Source = "SELECT * FROM admin WHERE name ='"&Trim(Request.fo

JS代码是这样
function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {
// W3C DOM
return document.getElementById(objectId);
} else if (document.all && document.all(objectId)) {
// MSIE 4 DOM
return document.all(objectId);
} else if (document.layers && document.layers[objectId]) {
// NN 4 DOM.. note: this won't find nested layers
return document.layers[objectId];
} else {
return false;
}
}
var mte=/[0-9]{1}[0-9]{2,3}-[1-9]{1}[0-9]{5,8}/;//验证电话的正则式;
function yz_mess_tel(){
var chkr=true;
if (!mte.test(document.mess.tel.value) || document.mess.tel.value.length=="" ){chkr=false;}
if(chkr){
getObject('mes_tel').innerHTML='<img src="image/yz_ok.gif" width="16" height="16">';
}else{
getObject('mes_tel').innerHTML='<img src="image/yz_cw.gif&q